let mongoose = require('mongoose')
let Schema = mongoose.Schema
let urea1Rule = new Schema({
        enter: {
            type: Number,
            default: 0
        },
        out: {
            type: Number,
            default: 0
        },

        leftover: {
            type: Number,
            default: 0

        },
        date: {
            type: Date
        },
        createTime: {
            type: Date
        },
        totals: {
            type: Number,
            default: 0
        },
        stringDate: {
            type: String,
            default: ''
        },
        name: {
            type: String,
            default: ''
        }

    })
    //大客户管理
let customRule = new Schema({
    name: {
        type: String
    },
    enter: {
        type: Number,
        default: 0
    },
    out: {
        type: Number,
        default: 0
    },

    leftover: {
        type: Number,
        default: 0

    },
    totals: {
        type: Number,
        default: 0
    },
    date: {
        type: Date
    },
    createTime: {
        type: Date
    },
    stringDate: {
        type: String,
        default: ''
    }

});
//用户登录表
let userRule = new Schema({
    username: {
        type: String
    },
    password: {
        type: String
    },
    email: {
        type: String
    },
    tel: {
        type: String
    },
    role: {
        type: String,
        default: '普通用户'
    },
    createTime: {
        type: Date,
        default: new Date()
    },
    display: {
        type: String,
        default: 'YES'
    }

});
//会员管理
let memberRule = new Schema({
        name: {
            type: String,
            default: ''
        },
        alias: {
            type: String,
            default: ''
        },
        createTime: {
            type: Date,
            default: new Date()
        },
        display: {
            type: String,
            default: 'YES'
        }
    })
    //散户
let sanhuRule = new Schema({
    name: {
        type: String,
        default: ''
    },
    alias: {
        type: String,
        default: ''
    },
    createTime: {
        type: Date,
        default: new Date()
    },
    display: {
        type: String,
        default: 'YES'
    }
})
let cardsManageRule = new Schema({
        name: {
            type: String,
            default: ''
        },
        alias: {
            type: String,
            default: ''
        },
        createTime: {
            type: Date,
            default: new Date()
        },
        display: {
            type: String,
            default: 'YES'
        }
    })
    //柴油
let chaiyouRule = new Schema({
        name: {
            type: String,
            default: ''
        },
        alias: {
            type: String,
            default: ''
        },
        createTime: {
            type: Date,
            default: new Date()
        },
        display: {
            type: String,
            default: 'YES'
        }
    })
    //尿素
let niaosuRule = new Schema({
        name: {
            type: String,
            default: ''
        },
        alias: {
            type: String,
            default: ''
        },
        createTime: {
            type: Date,
            default: new Date()
        },
        display: {
            type: String,
            default: 'YES'
        }
    })
    //油卡管理
let cardsRule = new Schema({
        name: {
            type: String
        },
        datas: {
            type: Number,
            default: 0
        },
        totals: {
            type: Number,
            default: 0
        },
        date: {
            type: Date
        },
        createTime: {
            type: Date,
            default: new Date()
        },
        stringDate: {
            type: String,
            default: ''
        }

    })
    //散户管理
let sanhuDataRule = new Schema({
        name: {
            type: String
        },
        datas: {
            type: Number,
            default: 0
        },
        totals: {
            type: Number,
            default: 0
        },
        date: {
            type: Date
        },
        createTime: {
            type: Date,
            default: new Date()
        },
        stringDate: {
            type: String,
            default: ''
        }

    })
    //散户管理
let ChaiyouDataRule = new Schema({
    name: {
        type: String
    },
    datas: {
        type: Number,
        default: 0
    },

    date: {
        type: Date
    },
    createTime: {
        type: Date,
        default: new Date()
    },
    stringDate: {
        type: String,
        default: ''
    }

})
let ChaiyouShouyiRule = new Schema({
    name: {
        type: String
    },
    datas: {
        type: Number,
        default: 0
    },

    date: {
        type: Date
    },
    createTime: {
        type: Date,
        default: new Date()
    },
    stringDate: {
        type: String,
        default: ''
    }

})
module.exports = { urea1Rule, customRule, userRule, memberRule, sanhuRule, cardsManageRule, chaiyouRule, niaosuRule, cardsRule, sanhuDataRule, ChaiyouDataRule, ChaiyouShouyiRule }